home *** CD-ROM | disk | FTP | other *** search
- Path: rcp6.elan.af.mil!rscernix!danpop
- From: danpop@mail.cern.ch (Dan Pop)
- Newsgroups: comp.lang.c
- Subject: Re: hex to dec function?
- Date: 14 Mar 96 20:32:19 GMT
- Organization: CERN European Lab for Particle Physics
- Message-ID: <danpop.826835539@rscernix>
- References: <4gdh1b$bg@mailhost.mwmicro.com> <4hl8mk$1er@info.uah.edu> <313EE885.4511@cmt.lpr.mail.carel.fi> <4i87sm$7n0@info.uah.edu>
- NNTP-Posting-Host: ues5.cern.ch
- X-Newsreader: NN version 6.5.0 #7 (NOV)
-
- In <4i87sm$7n0@info.uah.edu> gbacon@oreo (Greg Bacon) writes:
-
- >Ari Lukumies (aril@cmt.lpr.mail.carel.fi) wrote:
- >: Greg Bacon wrote:
- >: >
- >: > (void) printf("%d\n", strtol(strHexVal, (char **) NULL, 10));
- >: > [snip]
- >
- >: Just a quick sidenote: if you use strtol() in a printf call, use the
- >: correct format string, also: "%ld\n".
- >
- >OK, OK.. you got me. I should have commented that I was assuming int
- >and long were of the same length (a trait not often found on the
- >braindead iAPX platform :).
-
- The assumption is both brain dead and unnecessary.
-
- >The above works on most modern Unices.
-
- Who cares? Broken code which happens to "work" on your machine is even
- worse than broken code which doesn't work.
-
- BTW, I'm typing this article on a modern Unix system where int and long
- have different sizes.
-
- Dan
- --
- Dan Pop
- CERN, CN Division
- Email: danpop@mail.cern.ch
- Mail: CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
-